from django.urls import path

from admincharge.views.Login import LoginView
from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView
from .views.petmessage import PetNetMessageView, UploadPetImageView
from .views.custommessage import GetAllCustomList
from .views.adminmessage import EditPasswordApiView, GetAllAdminMessageApiView, changeAdminStatus,changeAdminSuper
from .views.Fostermessage import GetAllFosterList
from .views.sellpets import GetAllSellPetMessage, UploadSellPetImageView
from .views.shopgoodsmessage import GetAllShopGoodsMessage, UploadShopGoodsImageView
from .views.orderview import GetAllOrderMessage, deleteOneOrdermsg, deleteManyOrdermsg
from .views.staticanalysis import StaticAnalysisOrder
from .views.customcharge import GetAllCustomLoginMessage, changeStatus
from admincharge import views

urlpatterns = [
    # 用户登录的信息包括token
    path('login/', LoginView.as_view()),
    # 获取Token有效期的接口
    path('refresh/', TokenRefreshView.as_view(), name="refresh"),
    # 获取Token的有效性
    path('verify/', TokenVerifyView.as_view(), name="token_verify"),

    # 宠物信息url
    # 获取宠物档案的所有数据
    path('petmsg/', PetNetMessageView.as_view()),
    # 获取图片
    path('petmsg/uploadmessage/', UploadPetImageView.as_view()),
    # 删除一份数据
    path('petmsg/<int:id>/', views.petmessage.deleteOnePetmsg),
    # 删除多个数据
    path('petmsg/deletemany/', views.petmessage.deleteManyPetmsg),
    # 编辑数据
    path('petmsg/edit/', views.petmessage.editPetMsg),

    # 顾客信息url
    path('custommsg/', GetAllCustomList.as_view()),
    # 删除一份数据
    path('custommsg/<int:id>/', views.custommessage.deleteOneCustommsg),
    # 删除多个数据
    path('custommsg/deletemany/', views.custommessage.deleteManyCustommsg),
    # 添加数据前对pet数据段进行检验
    path('custommsg/beforeadd/', views.custommessage.beforeaddvalidate),
    # 编辑数据
    path('custommsg/edit/', views.custommessage.editCustomMsg),

    # 修改密码
    path('meta/', EditPasswordApiView.as_view()),

    # 寄养信息url
    path('fostermsg/', GetAllFosterList.as_view()),
    # 编辑
    path('fostermsg/edit/', views.Fostermessage.editFosterMsg),
    # 删除一份数据
    path('fostermsg/<int:id>/', views.Fostermessage.deleteOneFostermsg),
    # 删除多个数据
    path('fostermsg/deletemany/', views.Fostermessage.deleteManyFostermsg),

    # 出售信息url
    path('sellmsg/', GetAllSellPetMessage.as_view()),
    # 上传图片
    path('sellmsg/uploadmessage/', UploadSellPetImageView.as_view()),
    # 删除一份数据
    path('sellmsg/<int:id>/', views.sellpets.deleteOneSellmsg),
    # 删除多个数据
    path('sellmsg/deletemany/', views.sellpets.deleteManySellmsg),
    # 编辑数据
    path('sellmsg/edit/', views.sellpets.editSellMsg),

    # 商品信息url
    path('shopgoods/', GetAllShopGoodsMessage.as_view()),
    # 上传图片
    path('shopgoods/uploadmessage/', UploadShopGoodsImageView.as_view()),
    # 删除一份数据
    path('shopgoods/<int:id>/', views.shopgoodsmessage.deleteOneGoodmsg),
    # 删除多个数据
    path('shopgoods/deletemany/', views.shopgoodsmessage.deleteManyShopGoodsmsg),
    # 编辑数据
    path('shopgoods/edit/', views.shopgoodsmessage.editShopGoodsMsg),

    # 订单展示
    path('orderview/', GetAllOrderMessage.as_view()),
    # 删除一份数据
    path('orderview/<int:id>/', deleteOneOrdermsg),
    # 删除多个数据
    path('orderview/deletemany/', deleteManyOrdermsg),

    # 统计图->订单总数
    path('analysis/', StaticAnalysisOrder.as_view()),

    # 展示所有顾客登录的信息
    path('customsmessage/', GetAllCustomLoginMessage.as_view()),
    # 改变状态
    path('changestatus/', changeStatus),

    # 展示所有的管理员信息
    path('adminmessage/', GetAllAdminMessageApiView.as_view()),
    # 改变状态
    path('changeAdminStatus/', changeAdminStatus),
    # 改变权限
    path('changeAdminSuper/', changeAdminSuper),
]
